package router

import (
	"github.com/gin-gonic/gin"
	"mxshop-api/goods-web/api/banners"
	"mxshop-api/goods-web/middlewares"
)

func InitBannerRouter(Router *gin.RouterGroup) {
	BannerRouter := Router.Group("banners").Use(middlewares.Tracing()) //添加链路追踪
	{
		BannerRouter.GET("", banners.List)                                 //获取banner的列表
		BannerRouter.POST("", middlewares.JWTAuth(), banners.New)          //添加banner
		BannerRouter.PUT("/:id", middlewares.JWTAuth(), banners.Update)    //修改banner
		BannerRouter.DELETE("/:id", middlewares.JWTAuth(), banners.Delete) //删除banner
	}
}
